package nc.ui.arap.service;

import java.util.Map;

import nc.ui.ep.dj.DjPanel;
import nc.ui.ep.dj.FiFlowPanel;
import nc.ui.pub.ClientEnvironment;
import nc.vo.arap.exception.ExceptionHandler;
import nc.vo.arap.service.ServiceVO;
import nc.vo.pub.BusinessException;
import nc.vo.pub.pfflow.PfFlowBtnInfo;

public class AddBtn2Call extends AbstractCall{

	public AddBtn2Call(DjPanel djp) {
		super(djp);
	}

	public ServiceVO getServcallVO() {
		callvo=new ServiceVO();
		callvo.setClassname("nc.itf.arap.prv.IArapBillTypePrivate");
		callvo.setMethodname("findAddBtn2Info");
		callvo.setParamtype(new Class[] {String.class,String.class});
		callvo.setParam(new Object[] {parent.getDjSettingParam().getPk_corp(),
						parent.getDjDataBuffer().getCurrentDjlxbm()});
		return callvo;
	}

	public void handleResult(Map<String, Object> datas)
			throws BusinessException {
		if(parent instanceof FiFlowPanel){
			try {
				((FiFlowPanel)parent).updateAddLocalButtons((PfFlowBtnInfo[])datas.get(callvo.getCode()));
			} catch (Exception e) {
				ExceptionHandler.handleException(e);
			}
		}		
	}

}
